function [  ] = setType( this, type )
% DataPartition::setType( this:DataPartition, 
%                         type:char )
%              >>       [  ]
% 
% Description
% Set $.name$
% 
% Input
% 1. this : This @DataPartition object
% 2. type : {'k_fold', 'hold_out}
%           Character partition type name
% Output
% 0. 
% 
% Syntax
% ~. this.setType();
% ~. this.setType(name);
% 
% Example
% 

if nargin == 1
    type = 'k_fold';
end

switch lower(type)
    case {'k_fold', ''}
        this.type = 'k_fold';
    case 'hold_out'
        this.type = 'hold_out';
    otherwise
        error('BatErr: Invalid @DataPartition type name.');
end

end
